package com.ray.mybatisdemo.web;

import com.ray.mybatisdemo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * User: Ray.Shaw <p />
 * Time: 2019/10/30 15:51  <p />
 * Version: V1.0  <p />
 * Description:  <p />
 */
@RestController
@RequestMapping("/test")
public class TestController {
    @Autowired
    private UserService userService;

    @RequestMapping("getUser/{id}")
    public String GetUser(@PathVariable int id){
        return userService.selectOne(id).toString();
    }

    @RequestMapping("getUser")
    public String GetUserAll(){
        return userService.getAll().toString();
    }
}
